home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.ShipBossLaserB
- {
- var x;
- var y;
- var id;
- var dir;
- var speed;
- var color;
- var clip;
- var xMov = 0;
- var yMov = 0;
- var Name = "shipBossLaserB";
- var power = 20;
- var yank = false;
- function ShipBossLaserB(px, py, pcolor, pDir, pspeed, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.dir = pDir;
- this.speed = pspeed;
- this.color = pcolor;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("shipBossLaserB","shipBossLaserB" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.id = this.id;
- if(this.dir == "UL")
- {
- this.xMov = -1 * this.speed;
- this.yMov = -0.66 * this.speed;
- this.x += this.speed;
- this.y += 0.66 * this.speed;
- }
- else if(this.dir == "DL")
- {
- this.xMov = -1 * this.speed;
- this.yMov = 0.66 * this.speed;
- this.x += this.speed;
- this.y -= 0.66 * this.speed;
- }
- else if(this.dir == "UR")
- {
- this.xMov = this.speed;
- this.yMov = -0.66 * this.speed;
- this.x -= this.speed;
- this.y += 0.66 * this.speed;
- }
- else if(this.dir == "DR")
- {
- this.xMov = this.speed;
- this.yMov = 0.66 * this.speed;
- this.x -= this.speed;
- this.y -= 0.66 * this.speed;
- }
- this.clip.gotoAndStop(this.color + this.dir);
- }
- function hit()
- {
- this.yank = true;
- }
- function main()
- {
- this.xMov *= 1.02;
- this.yMov *= 1.02;
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
- this.yank = true;
- }
- if(this.x > 1050 || this.x < -50 || this.y > 650 || this.y < -50)
- {
- this.yank = true;
- }
- if(this.yank)
- {
- _root.removeEnemyShot("shipBossLaserB" + this.id);
- this.yank = false;
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-